File Redirection

There are mechanisms within HTML to 'redirect' a web browser to a different file. An example is given in this directory. There is a 'missing.acgi' Applescript which, when called, redirects the browser to the root index file.

Note that this redirection is automatic: the user is not greated by a web page which asks them to follow another link, the new web page is automatically loaded.

The important element of the redirect Applescript is the HTML headers it returns:

HTTP/1.0 302 Found
Location: Location: http://server_name/index.html
As opposed to the headers which normally precede a web page:
HTTP/1.0 200 OK
Server: NetPresenz/4.1
MIME-Version: 1.0
Content-type: text/html
Note that you do not need to include these headers in your web page: they are automatically prepended by NetPresenz. However the information passed back by a CGI does not have any headers prepended, so a CGI can do file redirection.

To test out the redirection cgi follow the (invalid) link below: This link doesn't exist. Note that you will be redirected to the Home page of the showcase.